﻿using System;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Runtime.Serialization;

namespace FKRP.WP7.Library.SkeletonTracker
{
    [DataContract(Name = "joint")]
    public class Joint
    {
        [DataMember(Name = "color")] public string Color { get; set; }
        [DataMember(Name = "x1")] public int X1 { get; set; }
        [DataMember(Name = "y1")] public int Y1 { get; set; }
        [DataMember(Name = "x2")] public int X2 { get; set; }
        [DataMember(Name = "y2")] public int Y2 { get; set; }

        public Line GetLine()
        {
            var line = new Line();
            line.Stroke = new SolidColorBrush(Common.ParseColor(Color));
            line.StrokeThickness = 6;
            line.X1 = X1 * 1.5;
            line.X2 = X2 * 1.5;
            line.Y1 = Y1 * 1.5;
            line.Y2 = Y2 * 1.5;

            return line;
        }
    }
}
